CC = gcc
CFLAGE = -g -Wall
OBJ = cvpn_mysql.o test.o
LINK = $(CC) -o
TARGET = test
MYSQL_LIBS = $(shell mysql_config --libs) 
MYSQL_INCL = $(shell mysql_config --cflags)
LIBS = -L$(MYSQL_LIBS)
INCPATH = -I./ $(MYSQL_INCL)

$(TARGET):$(OBJ)
	$(LINK) $@ $(OBJ) $(LIBS)
	@rm -rf $(OBJ)
%.o:%.c cvpn_mysql.h
	$(CC) $(CFLAGE) $(INCPATH) -c $< -o $@
clean:
	-rm -f *.o test cvpn
